<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>CSS 层叠层创建使用示例</title>
</head>
<body>
<style>
  /* 创建A,B两个分层 */
  @layer A,B;
  /* 未分层中 text-decoration 优先级高*/
  h1 { 
    color: orange;
    background-color: green; 
    text-decoration: overline pink !important; 
    box-shadow: 5px 5px lightgreen !important;
  }
  
  /* 分层A中 box-shadow 优先级高*/
  @layer A {
    h1 {
      color: grey; 
      background-color: black !important;
      text-decoration: line-through grey; 
      box-shadow: -5px -5px lightblue !important;
      font-style: normal;
      font-weight: normal !important;
    }
  }
  @layer B {
    h1 { 
      color: aqua;
      background: yellow !important;
      text-decoration: underline aqua;
      box-shadow: -5px 5px magenta !important;
      font-style: italic;
      font-weight: bold !important;
    }
  }
  </style>
  <div>
    <!-- 内联的color与background-color属性优先级最高 -->
    <h1 style="color: yellow; background-color: maroon !important;">Inline styles</h1>
  </div>
</body>
</html>